-- skill_add_burn
-- create by zhuangsl
-- 施放xx技能，附带燃烧效果

return {
    apply = function(prop, baseValue)
        -- 提升的值
        return prop[3];
    end,

    -- 释放技能时触发
    trigger = function(who, prop, arg)
        local target = arg;

        local propId = PropM.getPropId("burn");

        -- v为燃烧威力，传入时需要先通过v计算伤害
        local v = prop[3];
        local floor = DungeonM.currentLayer();
        local dungeonId = DungeonM.getDungeonId();
        if dungeonId == nil then
            dungeonId = ME.user.dbase:query("currentDungeon");
        end
        local layerFix = DungeonAreaM.query(dungeonId,"layer_fix");
        local damage = math.modf(floor * (60 + layerFix) * v / 60 / 1000);
        damage = math.max(1, damage);

        -- 减益状态
        local effectRound = CombatM.getRound() + 3;
        local arr = ({ propId, 1, damage, effectRound, });

        local condition = {
            ["prop"] = arr,
            ["end_round"] = effectRound,
        };

        -- 附加状态
        CombatStatusM.applyStatus(target, "burn", condition);

        return arr;
    end,

    record = function(target, prop, path)
        return false;
    end
};
